package com.selenium.core.functionlibrary;

import org.apache.commons.validator.GenericValidator;

/**
 * Provides methods for various utility operations
 * 
 * @author tbhadauria
 *
 */
public class Misc {
	
	/**
	 * Returns the number of not null values in an array.
	 * 
	 * @param array
	 * 		One dimensional String array	
	 * @return
	 * 		count of non null elements in one dimensional array.
	 */

	public static int countOfNonNullValues (String[] array) {
		int count = 0;
		for(String s:array) {
			if(!GenericValidator.isBlankOrNull(s)) {
				count++;				
			}
		}
		return count;
	}
}
